<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel='stylesheet' href='../rurple.css' type='text/css'>
<title>Beepers</title>
</head>
<body>
<h2 class="title">7. Beepers</h2>
<p>In this lesson, we will learn about the all important beepers!</p>
<!--====================================-->
<hr width="50%">
<a name="Beep" id="Beep"></a>
<h3 class="section">Beep! Beep!</h3>
<p>Reeborg's world includes <em>beepers</em>. These are small objects (drawn
fairly big on the screen) that make a small beeping sound when they are
turned on. Reeborg can only hear beepers if he is standing right on top of
them, on the same corner. He can pick them up and carry them (turned off) in
his pockets, or he can put them down (turning them on automatically).</p>
<p>You can instruct Reeborg to pick up beepers, through the
<tt>pick_beeper()</tt> command, or to put some down, through the
<tt>put_beeper()</tt> command. If you ask Reeborg to pick up beepers where
there are none, or to put down beepers if he doesn't carry any, he will
complain and shut down.</p>
<h3 class="try">Your turn</h3>
<p>Open up the world file beepers1.wld, which should look like the picture
below on the left. You open a world file by clicking on the <img alt=
"open world button" src="../../images/intro/btn_open_world.png"> button.
Write a program that will have Reeborg pick up the beeper, and put it down
after carrying it as illustrated.</p>
<p><img alt="beeper1" src="../../images/intro/beeper1.png"> <img alt=
"lead to" src="../../images/lead_to.png"> <img alt="beeper2" src=
"../../images/intro/beeper2.png"></p>
<!--=====================================================-->
<hr width="50%">
<a name="Beep2" id="Beep2"></a>
<h3 class="section">Changing beepers</h3>
<p>You can easily change Reeborg's world by adding beepers. To do so, you
just "right-click" on any intersection and select the number of beepers from
0 (used to remove any beepers present), 1, 2, 3, ..., 14, 15, 20, 40, 60, 80
or 99.</p>
<h3 class="try">Your turn</h3>
<p>Open up the world file beepers1.wld, and increase the number of beepers at
the corner of the third avenue and first street from 1 to 5. <span class=
"important">Save</span> this world file under the name beepers2.wld by
clicking on the <img alt="save world button" src=
"../../images/intro/btn_save_world.png"> button. Write a program that will
have Reeborg pick up all the beepers and then take one step away.</p>
<center>
<a href="6-left.htm"><img alt="previous" src=
"../../images/previous.png"> Making a left turn</a> - <a href=
"../lessons_toc.htm"><img alt="home" src="../../images/home.png"></a> - <a href=
"8-bugs.htm">Darn bugs! <img alt="next" src=
"../../images/next.png"></a>
</center>
</body>
</html>
